package com.example.wyz.classplus.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.example.wyz.classplus.R;
import com.example.wyz.classplus.base.BaseActivity;
import com.example.wyz.classplus.contract.atv.SubscribeMsgContract;
import com.example.wyz.classplus.presenter.SubscribeMsgPresenter;
import com.example.wyz.classplus.ui.adapter.SubscribeMsgAdapter;

import butterknife.BindView;

/**
 * Created by 10153 on 2017/5/29.
 */

public class SubscribeMsgActivity extends BaseActivity<SubscribeMsgContract.Presenter>
        implements SubscribeMsgContract.View{

    @BindView(R.id.rec_msg_subscribe) RecyclerView mSubscribeMsg;

    SubscribeMsgAdapter mAdapter;

    //BaseActivity方法重写&接口实现

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initRecyclerView();
        setHomeBtnEnable(true);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_msg_subscribe;
    }

    @Override
    protected void initPresenter() {
        this.mPresenter = new SubscribeMsgPresenter(this, this);
    }

    //contract.view接口实现


    //私有方法

    private void initRecyclerView(){
        mAdapter = new SubscribeMsgAdapter(this);
        mSubscribeMsg.setLayoutManager(new LinearLayoutManager(this));
        mSubscribeMsg.setAdapter(mAdapter);
    }
}
